package com.ws.haungjia.mapper;

import com.ws.haungjia.Bean.HoutaiUser;
import com.ws.haungjia.Bean.Huixian;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;

public interface HuserMapper {

    @Select("select * from houuser ")
    public List<HoutaiUser> cha();

    @Insert("insert into houuser(Hname,Hpass,Hshijian,Htouxiang) values(#{hname},#{hpass},#{hshijian},#{htouxiang})")
    int zengjia(@Param("hname") String hname, @Param("hpass") String hpass, @Param("hshijian") Date hshijian, @Param("htouxiang") String htouxiang);

    @Delete("delete from houuser where Hid=#{id}")
    int shan(int id);

    @Select("select * from houuser where Hid=#{id}")
    HoutaiUser huixian(int id);

    @Update("update houuser set Hname=#{hname},Hpass=#{hpass},Htouxiang=#{htouxiang} where Hid=#{hid}")
    int xiugai(HoutaiUser houtaiUser);

    @Select("select * from houuser where Hname like concat('%',#{mohu},'%')")
    List<HoutaiUser> sosuo(Huixian huiXian);

    @Update("update houuser set Hpass=#{mima} where Hid=#{id}")
    int chongzhi(@Param("id") int id, @Param("mima") String mima);
}
